package lliminngneibulei;

public class text02 {
    public static void main(String[] args) {
        phone app = new phone();
        app.alarm(new bell(){
            @Override
            public void ls() {
                System.out.println("小猪起床了");
            }
        });
        app.alarm(new bell() {
            @Override
            public void ls() {
                System.out.println("上学去了");
            }
        });
    }
}
interface bell{
    void ls();
}
class phone{
    public void alarm(bell a){
        System.out.println(a.getClass());
        a.ls();
    }

}
